﻿Imports System.Data.SqlClient
Imports System.Data.OleDb

Namespace DAO
    'Provider=SQLOLEDB;Data Source=VTLIM07;User ID=sa;Initial Catalog=BDPRUEB_VTTRADAPP
    Public Class Conexion
        Private _strConexion As String = "Provider=sqloledb;Data Source=VTLIM07;User ID=sa;Initial Catalog=BDPRUEB_VTTRADAPP"
        Private _conexion As OleDb.OleDbConnection '= New OleDb.OleDbConnection("Data Source=VTLIM07;User ID=sa;Initial Catalog=BDPRUEB_VTTRADAPP")

        Public Sub New()
            Conexion = New OleDbConnection("Provider=sqloledb;Data Source=VTLIM07;User ID=sa;Initial Catalog=BDPRUEB_VTTRADAPP")
        End Sub
        'Public Property connConexion() As SqlClient.SqlConnection
        '    Get
        '        Return _connConexion
        '    End Get
        '    Set(ByVal value As SqlClient.SqlConnection)
        '        _connConexion = value
        '    End Set
        'End Property

        'Public Property strConexion() As String
        '    Get
        '        Return _strConexion
        '    End Get
        '    Set(ByVal value As String)
        '        _strConexion = value
        '    End Set
        'End Property

        'Public Function executeQuerry() As DataTable

        '    Dim datareader As SqlDataReader
        '    Dim datatable As DataTable
        '    Try
        '        connConexion.Open()
        '        Dim queryCommand As SqlCommand = connConexion.CreateCommand()
        '        queryCommand.CommandText = "Select * from customer"
        '        datareader = queryCommand.ExecuteReader(CommandBehavior.CloseConnection)
        '    Catch ex As Exception
        '        connConexion.Close()
        '        Return datatable
        '    End Try
        '    datatable = New DataTable()
        '    datatable.Load(datareader)
        '    Return datatable
        'End Function
        Public Property Conexion() As OleDbConnection
            Get
                Return _conexion
            End Get
            Set(ByVal value As OleDbConnection)
                _conexion = value
            End Set
        End Property


    End Class

End Namespace
